<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>LTE-UNB: PhysicalLayer/Slot.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">LTE-UNB
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">PhysicalLayer/Slot.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_slot_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef _Slot_h_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define _Slot_h_</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;itpp/itbase.h&gt;</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="_physical_resource_block_8h.html">PhysicalResourceBlock.h</a>&quot;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="keyword">using namespace </span>std;
<a name="l00026"></a>00026 <span class="keyword">using namespace </span>itpp;
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="keyword">namespace </span>PhysicalLayer
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 
<a name="l00035"></a><a class="code" href="class_physical_layer_1_1_slot.html">00035</a> <span class="keyword">class </span><a class="code" href="class_physical_layer_1_1_slot.html">Slot</a>
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037    <span class="keyword">public</span>:
<a name="l00038"></a>00038 
<a name="l00043"></a>00043       <a class="code" href="class_physical_layer_1_1_slot.html">Slot</a>();
<a name="l00044"></a>00044       
<a name="l00049"></a>00049       <a class="code" href="class_physical_layer_1_1_slot.html">Slot</a>( vec PRBFrequecies );
<a name="l00050"></a>00050       
<a name="l00055"></a>00055       <span class="keyword">virtual</span> ~<a class="code" href="class_physical_layer_1_1_slot.html">Slot</a>();
<a name="l00056"></a>00056 
<a name="l00061"></a>00061       <span class="keywordtype">void</span> initialize( <span class="keyword">const</span> vec PRBFrequencies );
<a name="l00062"></a>00062       
<a name="l00067"></a>00067       <a class="code" href="class_physical_layer_1_1_physical_resource_block.html">PhysicalResourceBlock</a>* getPRB( <span class="keyword">const</span> <span class="keywordtype">double</span> Frequency );
<a name="l00068"></a>00068       
<a name="l00073"></a>00073       <a class="code" href="class_physical_layer_1_1_physical_resource_block.html">PhysicalResourceBlock</a>* getPRB( <span class="keyword">const</span> <span class="keywordtype">int</span> index );
<a name="l00074"></a>00074       
<a name="l00079"></a>00079       <span class="keywordtype">int</span> getNumberPRBs();
<a name="l00080"></a>00080       
<a name="l00081"></a>00081       
<a name="l00082"></a>00082            
<a name="l00083"></a>00083    <span class="keyword">protected</span>:
<a name="l00084"></a>00084       
<a name="l00089"></a><a class="code" href="class_physical_layer_1_1_slot.html#a968c26fae312d3eac02cc4b60132f063">00089</a>       Array&lt;PhysicalResourceBlock*&gt; <a class="code" href="class_physical_layer_1_1_slot.html#a968c26fae312d3eac02cc4b60132f063">PRBs_</a>;
<a name="l00090"></a>00090    
<a name="l00091"></a>00091    
<a name="l00092"></a>00092    <span class="keyword">private</span>:
<a name="l00093"></a>00093    
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 };
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 };
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 <span class="keyword">inline</span>
<a name="l00100"></a>00100 <a class="code" href="class_physical_layer_1_1_physical_resource_block.html">PhysicalLayer::PhysicalResourceBlock</a>*
<a name="l00101"></a>00101 <a class="code" href="class_physical_layer_1_1_slot.html#a6de1b8a154c2eb9dd0fa95f660afd499">PhysicalLayer::</a>
<a name="l00102"></a><a class="code" href="class_physical_layer_1_1_slot.html#a6de1b8a154c2eb9dd0fa95f660afd499">00102</a> <a class="code" href="class_physical_layer_1_1_slot.html#a6de1b8a154c2eb9dd0fa95f660afd499">Slot::getPRB</a>( <span class="keywordtype">double</span> Frequency )
<a name="l00103"></a>00103 {
<a name="l00104"></a>00104    <span class="keywordtype">int</span> size = PRBs_.size();
<a name="l00105"></a>00105    <span class="keywordtype">int</span> index = -1;
<a name="l00106"></a>00106    <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i = 0; i &lt; size; ++i )
<a name="l00107"></a>00107    {
<a name="l00108"></a>00108       <span class="keywordflow">if</span>( Frequency == PRBs_( i )-&gt;getFrequency() )
<a name="l00109"></a>00109       {
<a name="l00110"></a>00110          index = i;
<a name="l00111"></a>00111          <span class="keywordflow">break</span>;
<a name="l00112"></a>00112       }
<a name="l00113"></a>00113    }
<a name="l00114"></a>00114    
<a name="l00115"></a>00115    <span class="keywordflow">if</span>( index != -1 )
<a name="l00116"></a>00116    {
<a name="l00117"></a>00117       <span class="keywordflow">return</span> getPRB( index );
<a name="l00118"></a>00118    }
<a name="l00119"></a>00119    <span class="keywordflow">else</span>
<a name="l00120"></a>00120    {
<a name="l00121"></a>00121       it_error(<span class="stringliteral">&quot;Slot: Frequency does not exist.&quot;</span>);
<a name="l00122"></a>00122    }
<a name="l00123"></a>00123 };
<a name="l00124"></a>00124 
<a name="l00125"></a>00125 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 <span class="keyword">inline</span>
<a name="l00128"></a>00128 <a class="code" href="class_physical_layer_1_1_physical_resource_block.html">PhysicalLayer::PhysicalResourceBlock</a>*
<a name="l00129"></a>00129 <a class="code" href="class_physical_layer_1_1_slot.html#a6de1b8a154c2eb9dd0fa95f660afd499">PhysicalLayer::</a>
<a name="l00130"></a><a class="code" href="class_physical_layer_1_1_slot.html#aa330471d9af2801eee306632cfd9cdfe">00130</a> <a class="code" href="class_physical_layer_1_1_slot.html#a6de1b8a154c2eb9dd0fa95f660afd499">Slot::getPRB</a>( <span class="keywordtype">int</span> index )
<a name="l00131"></a>00131 {
<a name="l00132"></a>00132    <a class="code" href="class_physical_layer_1_1_physical_resource_block.html">PhysicalResourceBlock</a>* prb;
<a name="l00133"></a>00133    <span class="keywordflow">if</span> ( index &lt; PRBs_.size() )
<a name="l00134"></a>00134    {
<a name="l00135"></a>00135       prb = PRBs_( index );
<a name="l00136"></a>00136    }
<a name="l00137"></a>00137    <span class="keywordflow">else</span>
<a name="l00138"></a>00138    {
<a name="l00139"></a>00139       it_error(<span class="stringliteral">&quot;Slot: Index out of range&quot;</span>);
<a name="l00140"></a>00140    }  
<a name="l00141"></a>00141    
<a name="l00142"></a>00142    <span class="keywordflow">return</span> prb;
<a name="l00143"></a>00143 };
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 <span class="keyword">inline</span>
<a name="l00148"></a>00148 <span class="keywordtype">int</span>
<a name="l00149"></a>00149 <a class="code" href="class_physical_layer_1_1_slot.html#a68c1b01cc8e8b46b42038e96f791bb87">PhysicalLayer::</a>
<a name="l00150"></a><a class="code" href="class_physical_layer_1_1_slot.html#a68c1b01cc8e8b46b42038e96f791bb87">00150</a> <a class="code" href="class_physical_layer_1_1_slot.html#a68c1b01cc8e8b46b42038e96f791bb87">Slot::getNumberPRBs</a>()
<a name="l00151"></a>00151 {
<a name="l00152"></a>00152    <span class="keywordflow">return</span> PRBs_.size();  
<a name="l00153"></a>00153 };
<a name="l00154"></a>00154 
<a name="l00155"></a>00155 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 <span class="preprocessor">#endif</span>
<a name="l00158"></a>00158 <span class="preprocessor"></span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 25 2012 22:25:34 for LTE-UNB by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
